1. Field of the Invention
The present invention relates to file management, and deals more particularly with a method and apparatus for quickly and efficiently navigating through a comparison of different versions of a file. The present invention provides a visual abstraction of the detected differences in the files, and can be used with files containing any type of ordered data, such as text (for example, programming source code), audio, video, etc., and with any number of versions of a file.
2. Description of the Related Art
Tools exist which compare different versions of the same file, and present that comparison to the user in a graphical user interface window. Often these tools are comparing source files for programming languages such as C, C++, etc. These comparison tools present the user with a set of detected differences. Typically, the comparison tool presents the information from two files, side by side, with the detected differences indicated in some way (such as using different fonts, different colors, an indication of line numbers where differences exist, etc.). From this comparison, the user examines the differences, and works to resolve them. For example, the user may decide to merge selected parts of the files to eliminate the difference, or he may decide that the difference was intentional and make no change. The files being compared are often large, containing thousands of lines of code, and may have hundreds or even thousand of differences. Additionally, the changes may be widely distributed throughout these thousands of lines of code.
The user typically navigates through the file comparison using standard window scrolling or keyboard manipulation. As an example of using standard window scrolling, a scroll bar will be presented along the side of a window when the file contains more data than can be displayed in that window. The user can move through the file by clicking on the scroll bar (to move one full page forward or back), by clicking on an arrow attached to the scroll bar (to move one line up or down), the user may drag a slider that is positioned on the scroll bar (to move a user-controlled distance forward or back), etc. As an example of using keyboard manipulation, the user may press a Page-Up or Page-Down key, a key representing a single line up or down, etc.
While these existing techniques of navigation allow the user to move around through the compared files, they are not tailored to the specific problem of comparing file differences and resolving those differences. Thus, a number of difficulties are encountered by users of file comparison tools. When the files being compared are very large, using standard window or keyboard controls to move one page or one line at a time is tedious and time-consuming. Some comparison tools avoid this by providing a facility for quickly jumping to the next (or the previous) difference. For example, a toolbar may include icons marked “Next Difference” and “Previous Difference”, or buttons may be provided for the “Next” and “Previous” functions. Or, function keys may be specially designated as performing the Next and Previous functions. These facilities present their own difficulties. When the next or previous difference is far removed from the one currently being viewed, jumping to that next or previous difference tends to cause the user to lose much contextual information. Without a clear understanding of the context in which a difference occurs, the user may be prone to making errors when trying to resolve that difference.
What is needed to give the user this contextual information when viewing a comparison of very large files is an abstract representation of the files, showing a visual overview of the detected differences. This overview should include such things as where the differences are located in relation to the overall file layout, the size of the differences in relation to the overall file size, and the distribution of the differences throughout the files. By showing the user this information in an overview approach, he will get a high-level understanding of the detected differences in the files. From this high-level understanding, he can make choices about where to begin the task of resolving the differences. The larger the files being compared are, and the larger the number of changes, the more beneficial it is to give the user some idea of the overall scope of the differences in this manner. For example, instead of merely starting with the first detected difference and proceeding sequentially through each difference until reaching the end, the user may prefer to begin with a part of the files having the lowest density of differences, or the part of the files having the smallest sized differences. Or, for example, the user may know that the simplest part of a particular file is at the end, and start with the differences detected nearer the end of the file. Conversely, instead of beginning with the simplest or smallest changes, the user may prefer to begin with the most difficult or the largest changes. The approach taken will depend on the nature of the files and their differences, and the user's particular preferences.
It will not be enough to provide this type of overview information in a “display-only” mode, however. To help the user work through the detected differences quickly and easily, a navigation tool is required with controls that allow the user to get to the particular difference he has decided to work on. When the overview is integrated with navigation controls that are defined specifically for the task of file comparison and difference resolution, then the user's productivity can be increased, the accuracy of his file changes can be increased, and the tedium of the change process can be minimized.
Accordingly, a need exists for a technique by which a user can quickly and efficiently navigate through detected differences between versions of a file, by using an abstract visual representation showing those differences in an overview approach. The overview should visually provide the user with a high-level understanding of where differences exist in files, the size of the differences, and the relative distribution of differences over the files as a whole. The proposed technique provides a visual abstraction of the detected differences in the files, and can be used with files containing any type of ordered data, such as text (for example, programming source code), audio, video, etc., and with any number of versions of a file.